#ifndef _CYCLE_FACTROY_H_
#define _CYCLE_FACTROY_H_


#include <map>
#include <string>
#include <mutex>
#include "cycle_ctrl.h"

using namespace std;

class CCycleFlyWeightFactory
{
public:
	CCycleFlyWeightFactory() {m_mapCycle.clear();}
	int DelScsiDev(const char * devName);
	int Clear();
	CCycle_Ctrl* CreateCycle(const char * stor_path,bool bReCheck = false);
	int DelDevText(char * devName);
	int GetDevNum()
	{
		return (int)m_mapCycle.size();
	} 

protected:
	map<string, CCycle_Ctrl*> m_mapCycle;
	map<string,string>	      m_mapDeviceText;

	mutex m_lock;
};

extern  CCycleFlyWeightFactory g_cycleFac;
#endif	//_CYCLE_FACTROY_H_
